<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/2/22
 * Time: 18:02
 */
declare(strict_types=1);

namespace App\Service;
use App\Model\Dao\MchAccountDao;
use App\Utils\RedisUtils;
use Hyperf\Di\Annotation\Inject;

class SettleService {

    /**
     * @Inject()
     * @var MchAccountDao
     */
    private $MchAccountDao;

    /**
     * @param $mchId
     * @param $param
     * 入队列
     */
    public function addMq($mchId, $param) {
        $param['mchAccountId'] = '';

        if (!empty($mchId)) {
            $mchAccount = $this->MchAccountDao->getByMchId($mchId);
            if (!!$mchAccount) {
                $param['mchAccountId'] = $mchAccount['id'];
            }
        }

        RedisUtils::redisResource()->rPush("MchAccountAccessList", serialize($param));
    }

}
